<template>
  <main class="main-content">
    <div class="content-wrapper">
      <!-- 轮播图区：仅在不是/case时显示 -->
      <section class="welcome-section" v-if="route.path !== '/case'">
        <el-carousel height="320px" indicator-position="outside" arrow="always" style="border-radius: 12px; overflow: hidden;">
          <el-carousel-item v-for="(img, idx) in carouselImages" :key="idx">
            <img :src="img" style="width:100%;height:320px;object-fit:cover;" />
          </el-carousel-item>
        </el-carousel>
      </section>
      <!-- 三栏功能区 -->
      <section class="features-section">
        <el-row :gutter="32" class="features-row">
          <el-col :xs="24" :sm="8">
            <el-card shadow="never" class="feature-card no-border">
              <div class="feature-icon feature-icon1">
                <i class="el-icon-message"></i>
              </div>
              <h3>留言咨询</h3>
              <p>在线提交您的法律问题，专业律师为您解答。</p>
              <el-button type="primary" size="small">去留言</el-button>
            </el-card>
          </el-col>
          <el-col :xs="24" :sm="8">
            <el-card shadow="never" class="feature-card no-border">
              <div class="feature-icon feature-icon2">
                <i class="el-icon-folder"></i>
              </div>
              <h3>案件管理</h3>
              <p>高效管理您的案件进度，随时随地查看详情。</p>
              <el-button type="success" size="small">查看案件</el-button>
            </el-card>
          </el-col>
          <el-col :xs="24" :sm="8">
            <el-card shadow="never" class="feature-card no-border">
              <div class="feature-icon feature-icon3">
                <i class="el-icon-user"></i>
              </div>
              <h3>律师团队</h3>
              <p>汇聚多名资深律师，为您提供全方位法律服务。</p>
              <el-button type="warning" size="small">了解团队</el-button>
            </el-card>
          </el-col>
        </el-row>
      </section>
    </div>
  </main>
</template>
<script setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import { useCaseStore } from '@/stores/caseStore'
// 自动引入 assets/imgs 下所有图片
const imgs = import.meta.glob('@/assets/imgs/*', { eager: true, import: 'default' })
const carouselImages = Object.values(imgs)
const route = useRoute()

const showCaseTable = ref(false)
const caseStore = useCaseStore()

function handleShowCaseTable() {
  showCaseTable.value = true
}
</script>

<style scoped>
.main-content {
  padding-top: 75px;
  padding-left: 0px;
  padding-right:0px;
  flex: 1 1 0%;
  overflow-y: auto;
  background: #f6f8fa;
  height: 100%;
  min-height: 100%;
  width: 100%;
  min-width: 0;
}

.content-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100%;
}

.welcome-section {
  text-align: center;
  padding: 40px 0;
  background: linear-gradient(135deg, #e3f0ff 0%, #f6f8fa 100%);
  border-radius: 12px;
  margin-bottom: 32px;
}

.welcome-section h1 {
  font-size: 2.4rem;
  font-weight: bold;
  margin-bottom: 16px;
  color: #2d8cf0;
}

.welcome-desc {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-btn {
  font-size: 1rem;
  padding: 12px 32px;
}

.features-section {
  margin-bottom: 32px;
}

.features-row {
  width: 100%;
}

.feature-card {
  text-align: center;
  border-radius: 12px;
  margin-bottom: 24px;
  min-height: 240px;
  border: 0 !important;
  box-shadow: none !important;
  background: #fff;
  padding: 24px;
}

.no-border {
  border: 0 !important;
  box-shadow: none !important;
}

.feature-icon {
  font-size: 2.4rem;
  margin: 16px 0 12px 0;
  color: #fff;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-left: auto;
  margin-right: auto;
}

.feature-icon1 {
  background: linear-gradient(135deg, #2d8cf0, #66b1ff);
}

.feature-icon2 {
  background: linear-gradient(135deg, #19be6b, #5bdba8);
}

.feature-icon3 {
  background: linear-gradient(135deg, #ff9900, #ffd04b);
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 0 8px;
  }
  
  .welcome-section {
    padding: 24px 0;
  }
  
  .welcome-section h1 {
    font-size: 2rem;
  }
}
</style> 